package edu.ccut.saturn.workflow.startWorkFlowModule.code;

import java.text.SimpleDateFormat;
import java.util.Date;

import edu.ccut.saturn.component.DefaultComponent;
import edu.ccut.saturn.component.IParameterContext;

public class GetWorkFlowFinalTime extends DefaultComponent {
	public void execute(IParameterContext parameterContext) throws Exception {
		String limit_number = (String)parameterContext.getParameterValue(0);
		String start_time = (String)parameterContext.getParameterValue(1);
		SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
	//	Long timeout_number = format.parse(end_time).getTime() - format.parse(final_time).getTime();
		Long time  = format.parse(start_time).getTime() + Long.parseLong(limit_number);
		String final_time = format.format(new Date(time));
		parameterContext.setParameter(2, final_time);
	}

}